]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appSwitcher: Add option to limit to the current workspace
authorAdel Gadllah <adel.gadllah@gmail.com>
Thu, 4 Jul 2013 17:24:30 +0000 (19:24 +0200)
committerAdel Gadllah <adel.gadllah@gmail.com>
Thu, 18 Jul 2013 12:33:41 +0000 (14:33 +0200)
Add an option to limit the appSwitcher to the current workspace. For users
that use workspaces for task separation this more convient then current
behviour. While having to add an option is unfortunate there is no way to make
both groups happy as workspaces usage differes between different users / types
of users.

https://bugzilla.gnome.org/show_bug.cgi?id=703538

data/org.gnome.shell.gschema.xml.in.in
js/ui/altTab.js

index a12e7807f6a72880aff9ffd0ac06d5ca80bc74c2..816a1bc4e946bf3cc9fdb997e28da5dd00bf696c 100644 (file)
@@ -186,6 +186,19 @@ value here is from the GsmPresenceStatus enumeration.</_summary>
     </key>
   </schema>
 
+  <schema id="org.gnome.shell.app-switcher"
+          path="/org/gnome/shell/app-switcher/"
+          gettext-domain="@GETTEXT_PACKAGE@">
+    <key type="b" name="current-workspace-only">
+      <default>false</default>
+      <summary>Limit switcher to current workspace.</summary>
+      <description>
+       If true, only applications that have windows on the current workspace are shown in the switcher.
+       Otherwise, all applications are included.
+      </description>
+    </key>
+  </schema>
+
   <enum id="org.gnome.shell.window-switcher.AppIconMode">
     <value value="1" nick="thumbnail-only"/>
     <value value="2" nick="app-icon-only"/>
index 34d83e4cf02927501832b9e7569cb52a73fba01a..9d47d1e5f946dde3bc9a533b7dae8544f160085c 100644 (file)
@@ -436,8 +436,11 @@ const AppSwitcher = new Lang.Class({
         this._arrows = [];
 
         let windowTracker = Shell.WindowTracker.get_default();
+        let settings = new Gio.Settings({ schema: 'org.gnome.shell.app-switcher' });
+        let workspace = settings.get_boolean('current-workspace-only') ? global.screen.get_active_workspace()
+                                                                       : null;
         let allWindows = global.display.get_tab_list(Meta.TabList.NORMAL,
-                                                     global.screen, null);
+                                                     global.screen, workspace);
 
         // Construct the AppIcons, add to the popup
         for (let i = 0; i < apps.length; i++) {
@@ -447,7 +450,9 @@ const AppSwitcher = new Lang.Class({
             appIcon.cachedWindows = allWindows.filter(function(w) {
                 return windowTracker.get_window_app (w) == appIcon.app;
             });
-            this._addIcon(appIcon);
+            if (workspace == null || appIcon.cachedWindows.length > 0) {
+                this._addIcon(appIcon);
+            }
         }
 
         this._curApp = -1;